package com.restaurant.springboot.repositories;

import com.restaurant.springboot.entity.OrderEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;


import java.util.Date;
import java.util.List;

public interface OrderRepository extends JpaRepository<OrderEntity,Integer> {
     List<OrderEntity> findALLByUserId(int userId);
     Page<OrderEntity> findALLByUserId(Pageable pageable, int userId);
     Page<OrderEntity> findAllByCreateTimeBetween(Pageable pageable, Date startTime , Date endTime);

     boolean existsById(int Id);
}